home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
151-175
/
disk_156
/
flex
/
flex2
/
gnu.lib.src
/
opendir.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-05-06
|
657b
|
30 lines
/*
* BSD/Unix expansion library for Amiga.
*
* opendir() -- system independent directory code
*/
#include "dir.h"
DIR *
opendir(dirname)
char *dirname;
{
register DIR *my_dir, *AllocMem(/* int, int */) ;
struct FileLock *Lock(/* char *, int */), *CurrentDir(/* struct FileLock * */) ;
if ((my_dir = AllocMem(sizeof(DIR), 0)) == NULL)
return NULL ;
if (((my_dir->d_lock = Lock(dirname, ACCESS_READ)) == NULL)
/* If we can't examine it */
|| !Examine(my_dir->d_lock, &(my_dir->d_info))
/* Or it's not a directory */
|| (my_dir->d_info.fib_DirEntryType < 0))
{
FreeMem(my_dir, sizeof(DIR)) ;
return NULL ;
}
return my_dir ;
}